﻿namespace CodeParser
{
    public static class ArrayExtensions
    {

        public static T[] SubSet<T>(this T[] source, int index, int length)
        {
            var result = new T[length];
            for (var i = 0; i < length; i++)
            {
                result[i] = source[i + index];
            }
            return result;
        }

        public static T[] SubSet<T>(this T[] source, int index)
        {
            return SubSet(source, index, source.Length - index);
        }

    }
}
